from django.db import models

# Create your models here.
class Author(models.Model):
    SEX=[('F','女'),('M','男')]
    name=models.CharField(max_length=10)
    sex=models.CharField(max_length=1,choices=SEX)
    intor=models.CharField(max_length=255,verbose_name='简介')

class Article(models.Model):
    TYPE=[('0','原创'),('1','转载'),('2','翻译')]
    title=models.CharField(max_length=10,verbose_name='标题')
    content=models.TextField(verbose_name='内容')
    create=models.DateTimeField(auto_now_add=True)
    banben=models.CharField(max_length=1,choices=TYPE,verbose_name='版本')
    author=models.ForeignKey(Author,on_delete=models.CASCADE)